package jmine.tec.publisher;

import jmine.tec.annotations.Unmodifiable;
import jmine.tec.subscription.Publication;

@Unmodifiable
public class SimplePublication implements Publication {

    private static final long serialVersionUID = 3851612588131551852L;

    private final String text;

    private final long creationTime;

    public SimplePublication(String text) {
        super();
        this.text = text;
        this.creationTime = System.nanoTime();
    }

    public String getIdentification() {
        return this.text;
    }

    public String getText() {
        return "" + this.creationTime + ": " + this.text;
    }

    public boolean isNewerThan(Publication another) {
        return this != another;
    }

}
